package com.zt.dev.standardManage.entity.enmu;

public enum CategoryEnum {

    COMMOM(0,"类别一"),
    SPECIAL(1,"类别二"),
    IMPORTANT(2,"类别三");

    private Integer node;
    private String type;

    CategoryEnum(Integer node, String type) {
        this.node = node;
        this.type = type;
    }

    public Integer getNode() {
        return node;
    }

    public void setNode(Integer node) {
        this.node = node;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public static Integer getCode(String type){
        for(CategoryEnum categoryEnum : CategoryEnum.values()){
            if(categoryEnum.getType().equals(type) ){
                return categoryEnum.node;
            }
        }
        return null;
    }

    public static String getType(Integer node){
        for(CategoryEnum categoryEnum : CategoryEnum.values()){
            if(categoryEnum.getNode().equals(node)){
                return categoryEnum.type;
            }
        }
        return null;
    }
}
